package com.atguigu.mybatisplusdemo.mapper;

import com.atguigu.mybatisplusdemo.entity.User;
import com.atguigu.mybatisplusdemo.vo.UserVo;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface UserMapper extends BaseMapper<User> {

    User findMyUser(Long id);

    User findMyUserByWrapper(@Param(Constants.WRAPPER) Wrapper<User> wrapper);

//    IPage<UserVo> selectPageVo(IPage<?> page, Integer state);
    IPage<UserVo> selectPageVo(Page<User> page, Integer age);
    // 或者自定义分页类
//    MyPage selectPageVo(MyPage page);
    // 或者返回 List
//    List<UserVo> selectPageVo(IPage<UserVo> page, Integer state);

}
